﻿using System;

namespace Utility
{
	public interface IResolver
	{
		T Resolve<T>();
		T Resolve<T>(Type subType);
	}

	public static class Locator
	{
		public static IResolver Resolver = NullResolver.Null;
		public static T Resolve<T>()
		{
			return Resolver.Resolve<T>();
		}

		public static T Resolve<T>(Type subType)
		{
			return Resolver.Resolve<T>(subType);
		}
	}

	public class NullResolver : IResolver
	{
		public static readonly IResolver Null = new NullResolver();
		private NullResolver() { }
		public T Resolve<T>()
		{
			return default(T);
		}

		public T Resolve<T>(Type subType)
		{
			return default(T);
		}
	}
}
